home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / gnu / gas / src138.zoo / ns32k-opcode.h < prev    next >
C/C++ Source or Header  |  1991-01-21  |  24KB  |  435 lines

  1. /* ns32k-opcode.h -- Opcode table for National Semi 32k processor
  2.    Copyright (C) 1987 Free Software Foundation, Inc.
  3.  
  4. This file is part of GAS, the GNU Assembler.
  5.  
  6. GAS is free software; you can redistribute it and/or modify
  7. it under the terms of the GNU General Public License as published by
  8. the Free Software Foundation; either version 1, or (at your option)
  9. any later version.
  10.  
  11. GAS is distributed in the hope that it will be useful,
  12. but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14. GNU General Public License for more details.
  15.  
  16. You should have received a copy of the GNU General Public License
  17. along with GAS; see the file COPYING.  If not, write to
  18. the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
  19.  
  20.  
  21. #ifdef SEQUENT_COMPATABILITY
  22. #define DEF_MODEC 20
  23. #define DEF_MODEL 21
  24. #endif
  25.  
  26. #ifndef DEF_MODEC
  27. #define DEF_MODEC 20
  28. #endif
  29.  
  30. #ifndef DEF_MODEL
  31. #define DEF_MODEL 20
  32. #endif
  33. /*
  34.    After deciding the instruction entry (via hash.c) the instruction parser
  35.    will try to match the operands after the instruction to the required set
  36.    given in the entry operandfield. Every operand will result in a change in
  37.    the opcode or the addition of data to the opcode.
  38.    The operands in the source instruction are checked for inconsistent
  39.    semantics.
  40.  
  41.     F : 32 bit float    general form
  42.     L : 64 bit float        "
  43.     B : byte            "
  44.     W : word            "
  45.     D : double-word            "
  46.     Q : quad-word            "
  47.     A : double-word        gen-address-form ie no regs allowed
  48.     d : displacement
  49.     b : displacement - pc relative addressing  acb
  50.     p : displacement - pc relative addressing  br bcond bsr cxp
  51.     q : quick
  52.     i : immediate (8 bits)
  53.         This is not a standard ns32k operandtype, it is used to build
  54.         instructions like    svc arg1,arg2
  55.         Svc is the instruction SuperVisorCall and is sometimes used to
  56.         call OS-routines from usermode. Some args might be handy!
  57.     r : register number (3 bits)
  58.     O : setcfg instruction optionslist
  59.     C : cinv instruction optionslist
  60.     S : stringinstruction optionslist
  61.     U : registerlist    save,enter
  62.     u : registerlist    restore,exit
  63.     M : mmu register
  64.     P : cpu register
  65.     g : 3:rd operand of inss or exts instruction
  66.     G : 4:th operand of inss or exts instruction
  67.         Those operands are encoded in the same byte.
  68.         This byte is placed last in the instruction.
  69.     f : operand of sfsr
  70.     H : sequent-hack for bsr (Warning)
  71.  
  72. column    1     instructions
  73.     2     number of bits in opcode.
  74.     3     number of bits in opcode explicitly
  75.         determined by the instruction type.
  76.     4     opcodeseed, the number we build our opcode
  77.         from.
  78.     5     operandtypes, used by operandparser.
  79.     6     size in bytes of immediate
  80. */
  81. struct ns32k_opcode {
  82.   char *name;
  83.   unsigned char opcode_id_size; /* not used by the assembler */
  84.   unsigned char opcode_size;
  85.   unsigned long opcode_seed;
  86.   char *operands;
  87.   unsigned char im_size;    /* not used by dissassembler */
  88.   char *default_args;        /* default to those args when none given */
  89.   char default_modec;        /* default to this addr-mode when ambigous
  90.                    ie when the argument of a general addr-mode
  91.                    is a plain constant */
  92.   char default_model;        /* is a plain label */
  93. };
  94.  
  95. struct ns32k_opcode ns32k_opcodes[]=
  96. {
  97.   { "absf",    14,24,    0x35be,    "1F2F",        4,    "",    DEF_MODEC,DEF_MODEL    },
  98.   { "absl",    14,24,    0x34be,    "1L2L",        8,    "",    DEF_MODEC,DEF_MODEL    },
  99.   { "absb",    14,24,    0x304e, "1B2B",        1,    "",    DEF_MODEC,DEF_MODEL    },
  100.   { "absw",    14,24,    0x314e, "1W2W",        2,    "",    DEF_MODEC,DEF_MODEL    },
  101.   { "absd",    14,24,    0x334e, "1D2D",        4,    "",    DEF_MODEC,DEF_MODEL    },
  102.   { "acbb",     7,16,    0x4c,    "2B1q3p",    1,    "",    DEF_MODEC,DEF_MODEL    },
  103.   { "acbw",     7,16,    0x4d,    "2W1q3p",    2,    "",    DEF_MODEC,DEF_MODEL    },
  104.   { "acbd",     7,16,    0x4f,    "2D1q3p",    4,    "",    DEF_MODEC,DEF_MODEL    },
  105.   { "addf",    14,24,    0x01be,    "1F2F",        4,    "",    DEF_MODEC,DEF_MODEL    },
  106.   { "addl",    14,24,    0x00be, "1L2L",        8,    "",    DEF_MODEC,DEF_MODEL    },
  107.   { "addb",     6,16,    0x00,    "1B2B",        1,    "",    DEF_MODEC,DEF_MODEL    },
  108.   { "addw",     6,16,    0x01,    "1W2W",        2,    "",    DEF_MODEC,DEF_MODEL    },
  109.   { "addd",     6,16,    0x03,    "1D2D",        4,    "",    DEF_MODEC,DEF_MODEL    },
  110.   { "addcb",     6,16,    0x10,    "1B2B",        1,    "",    DEF_MODEC,DEF_MODEL    },
  111.   { "addcw",     6,16,    0x11,    "1W2W",        2,    "",    DEF_MODEC,DEF_MODEL    },
  112.   { "addcd",     6,16,    0x13,    "1D2D",        4,    "",    DEF_MODEC,DEF_MODEL    },
  113.   { "addpb",    14,24,    0x3c4e,    "1B2B",        1,    "",    DEF_MODEC,DEF_MODEL    },
  114.   { "addpw",    14,24,    0x3d4e,    "1W2W",        2,    "",    DEF_MODEC,DEF_MODEL    },
  115.   { "addpd",    14,24,    0x3f4e,    "1D2D",        4,    "",    DEF_MODEC,DEF_MODEL    },
  116.   { "addqb",     7,16,    0x0c,    "2B1q",        1,    "",    DEF_MODEC,DEF_MODEL    },
  117.   { "addqw",     7,16,    0x0d,    "2W1q",        2,    "",    DEF_MODEC,DEF_MODEL    },
  118.   { "addqd",     7,16,    0x0f,    "2D1q",        4,    "",    DEF_MODEC,DEF_MODEL    },
  119.   { "addr",     6,16,    0x27,    "1A2D",        4,    "",    21,21    },
  120.   { "adjspb",    11,16,    0x057c,    "1B",        1,    "",    DEF_MODEC,DEF_MODEL    },
  121.   { "adjspw",    11,16,    0x057d,    "1W",         2,    "",    DEF_MODEC,DEF_MODEL    },
  122.   { "adjspd",    11,16,    0x057f,    "1D",         4,    "",    DEF_MODEC,DEF_MODEL    },
  123.   { "andb",     6,16,    0x28,    "1B2B",        1,    "",    DEF_MODEC,DEF_MODEL    },
  124.   { "andw",     6,16,    0x29,    "1W2W",        2,    "",    DEF_MODEC,DEF_MODEL    },
  125.   { "andd",     6,16,    0x2b,    "1D2D",        4,    "",    DEF_MODEC,DEF_MODEL    },
  126.   { "ashb",    14,24,    0x044e,    "1B2B",        1,    "",    DEF_MODEC,DEF_MODEL    },
  127.   { "ashw",    14,24,    0x054e,    "1B2W",        1,    "",    DEF_MODEC,DEF_MODEL    },
  128.   { "ashd",    14,24,    0x074e,    "1B2D",        1,    "",    DEF_MODEC,DEF_MODEL    },
  129.   { "beq",     8,8,    0x0a,    "1p",        0,    "",    21,21    },
  130.   { "bne",     8,8,    0x1a,    "1p",        0,    "",    21,21    },
  131.   { "bcs",     8,8,    0x2a,    "1p",        0,    "",    21,21    },
  132.   { "bcc",     8,8,    0x3a,    "1p",        0,    "",    21,21    },
  133.   { "bhi",     8,8,    0x4a,    "1p",        0,    "",    21,21    },
  134.   { "bls",     8,8,    0x5a,    "1p",        0,    "",    21,21    },
  135.   { "bgt",     8,8,    0x6a,    "1p",        0,    "",    21,21    },
  136.   { "ble",     8,8,    0x7a,    "1p",        0,    "",    21,21    },
  137.   { "bfs",     8,8,    0x8a,    "1p",        0,    "",    21,21    },
  138.   { "bfc",     8,8,    0x9a,    "1p",        0,    "",    21,21    },
  139.   { "blo",     8,8,    0xaa,    "1p",        0,    "",    21,21    },
  140.   { "bhs",     8,8,    0xba,    "1p",        0,    "",    21,21    },
  141.   { "blt",     8,8,    0xca,    "1p",        0,    "",    21,21    },
  142.   { "bge",     8,8,    0xda,    "1p",        0,    "",    21,21    },
  143.   { "but",     8,8,    0xea,    "1p",        0,    "",    21,21    },
  144.   { "buf",     8,8,    0xfa,    "1p",        0,    "",    21,21    },
  145.   { "bicb",     6,16,    0x08,    "1B2B",        1,    "",    DEF_MODEC,DEF_MODEL    },
  146.   { "bicw",     6,16,    0x09,    "1W2W",        2,    "",    DEF_MODEC,DEF_MODEL    },
  147.   { "bicd",     6,16,    0x0b,    "1D2D",        4,    "",    DEF_MODEC,DEF_MODEL    },
  148.   { "bicpsrb",    11,16,    0x17c,    "1B",        1,    "",    DEF_MODEC,DEF_MODEL    },
  149.   { "bicpsrw",    11,16,    0x17d,    "1W",        2,    "",    DEF_MODEC,DEF_MODEL    },
  150.   { "bispsrb",    11,16,    0x37c,    "1B",        1,    "",    DEF_MODEC,DEF_MODEL    },
  151.   { "bispsrw",    11,16,    0x37d,    "1W",        2,    "",    DEF_MODEC,DEF_MODEL    },
  152.   { "bpt",     8,8,    0xf2,    "",        0,    "",    DEF_MODEC,DEF_MODEL    },
  153.   { "br",     8,8,    0xea,    "1p",        0,    "",    21,21    },
  154. #ifdef SEQUENT_COMPATABILITY
  155.   { "bsr",     8,8,    0x02,    "1H",        0,    "",    21,21    },
  156. #else
  157.   { "bsr",     8,8,    0x02,    "1p",        0,    "",    21,21    },
  158. #endif
  159.   { "caseb",    11,16,    0x77c,    "1B",        1,    "",    DEF_MODEC,DEF_MODEL    },
  160.   { "casew",    11,16,    0x77d,    "1W",        2,    "",    DEF_MODEC,DEF_MODEL    },
  161.   { "cased",    11,16,    0x77f,    "1D",        4,    "",    DEF_MODEC,DEF_MODEL    },
  162.   { "cbitb",    14,24,    0x084e,    "1B2D",        1,    "",    DEF_MODEC,DEF_MODEL    },
  163.   { "cbitw",    14,24,    0x094e,    "1W2D",        2,    "",    DEF_MODEC,DEF_MODEL    },
  164.   { "cbitd",    14,24,    0x0b4e,    "1D2D",        4,    "",    DEF_MODEC,DEF_MODEL    },
  165.   { "cbitib",    14,24,    0x0c4e,    "1B2D",        1,    "",    DEF_MODEC,DEF_MODEL    },
  166.   { "cbitiw",    14,24,    0x0d4e,    "1W2D",        2,    "",    DEF_MODEC,DEF_MODEL    },
  167.   { "cbitid",    14,24,    0x0f4e,    "1D2D",        4,    "",    DEF_MODEC,DEF_MODEL    },
  168.   { "checkb",    11,24,    0x0ee,    "2A3B1r",    1,    "",    DEF_MODEC,DEF_MODEL    },
  169.   { "checkw",    11,24,    0x1ee,    "2A3W1r",    2,    "",    DEF_MODEC,DEF_MODEL    },
  170.   { "checkd",    11,24,    0x3ee,    "2A3D1r",    4,    "",    DEF_MODEC,DEF_MODEL    },
  171.   { "cinv",    14,24,    0x271e,    "2D1C",        4,    "",    DEF_MODEC,DEF_MODEL    },
  172.   { "cmpf",    14,24,    0x09be,    "1F2F",        4,    "",    DEF_MODEC,DEF_MODEL    },
  173.   { "cmpl",    14,24,    0x08be,    "1L2L",        8,    "",    DEF_MODEC,DEF_MODEL    },
  174.   { "cmpb",     6,16,    0x04,    "1B2B",        1,    "",    DEF_MODEC,DEF_MODEL    },
  175.   { "cmpw",     6,16,    0x05,    "1W2W",        2,    "",    DEF_MODEC,DEF_MODEL    },
  176.   { "cmpd",     6,16,    0x07,    "1D2D",        4,    "",    DEF_MODEC,DEF_MODEL    },
  177.   { "cmpmb",    14,24,    0x04ce,    "1A2A3b",    1,    "",    DEF_MODEC,DEF_MODEL    },
  178.   { "cmpmw",    14,24,    0x05ce,    "1A2A3b",    2,    "",    DEF_MODEC,DEF_MODEL    },
  179.   { "cmpmd",    14,24,    0x07ce,    "1A2A3b",    4,    "",    DEF_MODEC,DEF_MODEL    },
  180.   { "cmpqb",     7,16,    0x1c,    "2B1q",        1,    "",    DEF_MODEC,DEF_MODEL    },
  181.   { "